package com.cheesmo.nzb.model.impl;

import java.util.ArrayList;
import java.util.List;

import com.cheesmo.nzb.model.File;
import com.cheesmo.nzb.model.Group;
import com.cheesmo.nzb.model.Segment;

public class FileImpl
		implements File
{
	List<Group> groups = null;
	List<Segment> segments = null;
	int date;
	String poster;
	String subject;

	public FileImpl(String poster, String subject, int date)
	{
		this.groups = new ArrayList<Group>();
		this.segments = new ArrayList<Segment>();
		this.date = date;
		this.poster = poster;
		this.subject = subject;
	}

	public List<Segment> getSegments() {
		return this.segments;
	}

	public List<Group> getGroups() {
		return this.groups;
	}

	public void addSegment(Segment segment) {
		this.segments.add(segment);
	}

	public void addGroup(Group group) {
		this.groups.add(group);
	}

	public String getPoster() {
		return this.poster;
	}

	public String getSubject() {
		return this.subject;
	}

	public int getDate() {
		return this.date;
	}

	public String toString() {
		String toReturn = "";
		toReturn = toReturn + "\n[File]";
		toReturn = toReturn + "\n\t\tdate=" + this.date;
		toReturn = toReturn + "\n\t\tposter=" + this.poster;
		toReturn = toReturn + "\n\t\tsubject=" + this.subject;
		for (int i = 0; i < this.groups.size(); i++) {
			toReturn = toReturn + this.groups.get(i).toString();
		}
		for (int i = 0; i < this.segments.size(); i++) {
			toReturn = toReturn + this.segments.get(i).toString();
		}
		return toReturn;
	}
}